﻿using System;
using System.Web.UI.WebControls;

namespace NetDon.OA.Portal.Admin
{
    using Data.EntityClasses;

    public partial class EventView : PageBase
    {
        public Guid EventId
        {
            get
            {
                return Parameters.GetRequiredGuid("EventId");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var log = new LogEntity(EventId);
                FormPanel1.DataSource = log;
                FormPanel1.DataBind();

                var literal = new Literal
                                  {
                                      Text = string.IsNullOrEmpty(log.Message)?"None":Server.HtmlEncode(log.Message).Replace(Environment.NewLine, "<br/>")
                                  };
                panelMessage.Controls.Add(literal);
                CancelButton = btnClose;
            }
        }
    }
}
